package com.example.administrator.yuejian35.Home;

import com.example.administrator.yuejian35.Config;

import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * Created by JUSTIN on 2017/9/26.
 */

public class HomeModel {
    private Retrofit retrofit;
    private HomeServer service;

    public HomeModel(){
        retrofit =
                new Retrofit.Builder()
                        .baseUrl(Config.BASE_URL)
                        .addConverterFactory(GsonConverterFactory.create())
                        .build();
    }

    private void service(){
        service=retrofit.create(HomeServer.class);
    }

    public Call systempic()
    {
        service();
        return  service.systempic();
    }

    public Call activitylist()
    {
        service();
        return  service.activitylist();
    }

    public Call masterlist()
    {
        service();
        return  service.masterlist();
    }

    public Call gamelist()
    {
        service();
        return  service.gamelist();
    }

    /*public Call activity(int aid)
    {
        service();
        return  service.activity(aid);
    }*/

    public Call apply_activity(String aid,String uid,int psum,String msum) //报名
    {
        service();
        return  service.apply_activity(aid,uid,psum,msum);
    }

    public Call master_video(int coachid)//大师课程
    {
        service();
        return  service.master_video(coachid);
    }

    public Call collect(String aid,String uid,String type, String id) //收藏
    {
        service();
        return  service.collect(aid,uid,type,id);
    }

    public Call master_collect(String ciachid,String uid,String type, String id) //收藏
    {
        service();
        return  service.master_collect(ciachid,uid,type,id);
    }

    public Call game_hit(String gid,String type) //比赛点赞
    {
        service();
        return  service.game_hit(gid,type);
    }

    public Call post_hit(String pid,String type) //比赛点赞
    {
        service();
        return  service.post_hit(pid,type);
    }






}
